package com.xinli.xinlifm.http.bean;

import android.content.Intent;
import android.view.View;
import android.widget.Toast;

import com.xinli.xinlifm.R;
import com.xinli.xinlifm.view.activity.DianTaiActivity;
import com.xinli.xinlifm.view.activity.MyselfActivity;
import com.xinli.xinlifm.view.activity.NewfmActivity;
import com.xinli.xinlifm.view.activity.NewlessonActivity;
import com.xinli.xinlifm.view.activity.player.PlayerActivity;

import java.util.List;

/**
 * 首页
 * Created by zz on 16-10-12.
 */

public class HomeBean {

    private int code;
    private DataBean data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * id : 110
         * title : 短诗集
         * cover : http://ossimg.xinli001.com/20161003/acaf57bb7d68b09907137976dead30b9.jpg
         * value : 短诗集
         * type : tag
         * sort : 106
         */

        private List<TuijianBean> tuijian;
        /**
         * id : 1
         * cover : http://image.xinli001.com/20150706/143236a3b4ab51542065ad.png
         * name : 自我成长
         * sort : 100
         * flag : 0
         */

        private List<CategoryBean> category;

        private List<HotfmBean> hotfm;

        private List<NewfmBean> newfm;

        private List<NewlessonBean> newlesson;

        private List<DiantaiBean> diantai;

        public List<TuijianBean> getTuijian() {
            return tuijian;
        }

        public void setTuijian(List<TuijianBean> tuijian) {
            this.tuijian = tuijian;
        }

        public List<CategoryBean> getCategory() {
            return category;
        }

        public void setCategory(List<CategoryBean> category) {
            this.category = category;
        }

        public List<HotfmBean> getHotfm() {
            return hotfm;
        }

        public void setHotfm(List<HotfmBean> hotfm) {
            this.hotfm = hotfm;
        }

        public List<NewfmBean> getNewfm() {
            return newfm;
        }

        public void setNewfm(List<NewfmBean> newfm) {
            this.newfm = newfm;
        }

        public List<NewlessonBean> getNewlesson() {
            return newlesson;
        }

        public void setNewlesson(List<NewlessonBean> newlesson) {
            this.newlesson = newlesson;
        }

        public List<DiantaiBean> getDiantai() {
            return diantai;
        }

        public void setDiantai(List<DiantaiBean> diantai) {
            this.diantai = diantai;
        }

        public static class TuijianBean {
            private String id;
            private String title;
            private String cover;
            private String value;
            private String type;
            private String sort;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getCover() {
                return cover;
            }

            public void setCover(String cover) {
                this.cover = cover;
            }

            public String getValue() {
                return value;
            }

            public void setValue(String value) {
                this.value = value;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getSort() {
                return sort;
            }

            public void setSort(String sort) {
                this.sort = sort;
            }
        }

        public static class CategoryBean implements View.OnClickListener {
            private String id;
            private String cover;
            private String name;
            private String sort;
            private String flag;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getCover() {
                return cover;
            }

            public void setCover(String cover) {
                this.cover = cover;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getSort() {
                return sort;
            }

            public void setSort(String sort) {
                this.sort = sort;
            }

            public String getFlag() {
                return flag;
            }

            public void setFlag(String flag) {
                this.flag = flag;
            }

            @Override
            public void onClick(View v) {
                Toast.makeText(v.getContext(), getName() + "", Toast.LENGTH_LONG).show();
                Intent intent = new Intent(v.getContext(), MyselfActivity.class);
                intent.putExtra("name", getName());
                intent.putExtra("id", getId());
                v.getContext().startActivity(intent);
            }
        }

        public static class HotfmBean implements View.OnClickListener {
            private String id;
            private String title;
            private String cover;
            private String url;
            private String speak;
            private String favnum;
            private String viewnum;
            private Object background;
            private boolean is_teacher;
            private String absolute_url;
            private String object_id;
            /**
             * id : 988
             * title : 愈含
             * cover : http://ossimg.xinli001.com/20160630/89f1dfba7ea667a855e7603734b1c48d.png
             * fmnum : 12
             * user_id : 8550481
             * viewnum : 2239906
             * content : 世界和我爱着你，愈含的声音陪着你。 微信公共号：愈含
             * favnum : 1335
             * user : {"id":"8550481","username":"xxzcgmelody@126.com","nickname":"愈含","phone":null,"avatar":"http://ossimg.xinli001.com/20160630/89f1dfba7ea667a855e7603734b1c48d.png!80"}
             */

            private DiantaiBean diantai;
            private List<?> url_list;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getCover() {
                return cover;
            }

            public void setCover(String cover) {
                this.cover = cover;
            }

            public String getUrl() {
                return url;
            }

            public void setUrl(String url) {
                this.url = url;
            }

            public String getSpeak() {
                return speak;
            }

            public void setSpeak(String speak) {
                this.speak = speak;
            }

            public String getFavnum() {
                return favnum;
            }

            public void setFavnum(String favnum) {
                this.favnum = favnum;
            }

            public String getViewnum() {
                return viewnum;
            }

            public void setViewnum(String viewnum) {
                this.viewnum = viewnum;
            }

            public Object getBackground() {
                return background;
            }

            public void setBackground(Object background) {
                this.background = background;
            }

            public boolean isIs_teacher() {
                return is_teacher;
            }

            public void setIs_teacher(boolean is_teacher) {
                this.is_teacher = is_teacher;
            }

            public String getAbsolute_url() {
                return absolute_url;
            }

            public void setAbsolute_url(String absolute_url) {
                this.absolute_url = absolute_url;
            }

            public String getObject_id() {
                return object_id;
            }

            public void setObject_id(String object_id) {
                this.object_id = object_id;
            }

            public DiantaiBean getDiantai() {
                return diantai;
            }

            public void setDiantai(DiantaiBean diantai) {
                this.diantai = diantai;
            }

            public List<?> getUrl_list() {
                return url_list;
            }

            public void setUrl_list(List<?> url_list) {
                this.url_list = url_list;
            }

            @Override
            public void onClick(View v) {
                //TODO 跳转到播放详情也
                Intent intent = new Intent(v.getContext(), PlayerActivity.class);
                switch (v.getId()) {
                    case R.id.hotfm_lin1:
                        intent.putExtra("id", getId());
                        break;
                    case R.id.hotfm_lin2:
                         intent.putExtra("id", getId());
                        break;
                    case R.id.hotfm_lin3:
                          intent.putExtra("id", getId());
                        break;

                }
                v.getContext().startActivity(intent);
            }

            public static class DiantaiBean {
                private String id;
                private String title;
                private String cover;
                private String fmnum;
                private String user_id;
                private String viewnum;
                private String content;
                private String favnum;

                private UserBean user;

                public String getId() {
                    return id;
                }

                public void setId(String id) {
                    this.id = id;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }

                public String getCover() {
                    return cover;
                }

                public void setCover(String cover) {
                    this.cover = cover;
                }

                public String getFmnum() {
                    return fmnum;
                }

                public void setFmnum(String fmnum) {
                    this.fmnum = fmnum;
                }

                public String getUser_id() {
                    return user_id;
                }

                public void setUser_id(String user_id) {
                    this.user_id = user_id;
                }

                public String getViewnum() {
                    return viewnum;
                }

                public void setViewnum(String viewnum) {
                    this.viewnum = viewnum;
                }

                public String getContent() {
                    return content;
                }

                public void setContent(String content) {
                    this.content = content;
                }

                public String getFavnum() {
                    return favnum;
                }

                public void setFavnum(String favnum) {
                    this.favnum = favnum;
                }

                public UserBean getUser() {
                    return user;
                }

                public void setUser(UserBean user) {
                    this.user = user;
                }

                public static class UserBean {
                    private String id;
                    private String username;
                    private String nickname;
                    private Object phone;
                    private String avatar;

                    public String getId() {
                        return id;
                    }

                    public void setId(String id) {
                        this.id = id;
                    }

                    public String getUsername() {
                        return username;
                    }

                    public void setUsername(String username) {
                        this.username = username;
                    }

                    public String getNickname() {
                        return nickname;
                    }

                    public void setNickname(String nickname) {
                        this.nickname = nickname;
                    }

                    public Object getPhone() {
                        return phone;
                    }

                    public void setPhone(Object phone) {
                        this.phone = phone;
                    }

                    public String getAvatar() {
                        return avatar;
                    }

                    public void setAvatar(String avatar) {
                        this.avatar = avatar;
                    }
                }
            }
        }

        public static class NewfmBean implements View.OnClickListener {
            private String id;
            private String title;
            private String cover;
            private String url;
            private String speak;
            private String favnum;
            private String viewnum;
            private Object background;
            private boolean is_teacher;
            private String absolute_url;
            private String object_id;

            private DiantaiBean diantai;
            private List<?> url_list;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getCover() {
                return cover;
            }

            public void setCover(String cover) {
                this.cover = cover;
            }

            public String getUrl() {
                return url;
            }

            public void setUrl(String url) {
                this.url = url;
            }

            public String getSpeak() {
                return speak;
            }

            public void setSpeak(String speak) {
                this.speak = speak;
            }

            public String getFavnum() {
                return favnum;
            }

            public void setFavnum(String favnum) {
                this.favnum = favnum;
            }

            public String getViewnum() {
                return viewnum;
            }

            public void setViewnum(String viewnum) {
                this.viewnum = viewnum;
            }

            public Object getBackground() {
                return background;
            }

            public void setBackground(Object background) {
                this.background = background;
            }

            public boolean isIs_teacher() {
                return is_teacher;
            }

            public void setIs_teacher(boolean is_teacher) {
                this.is_teacher = is_teacher;
            }

            public String getAbsolute_url() {
                return absolute_url;
            }

            public void setAbsolute_url(String absolute_url) {
                this.absolute_url = absolute_url;
            }

            public String getObject_id() {
                return object_id;
            }

            public void setObject_id(String object_id) {
                this.object_id = object_id;
            }

            public DiantaiBean getDiantai() {
                return diantai;
            }

            public void setDiantai(DiantaiBean diantai) {
                this.diantai = diantai;
            }

            public List<?> getUrl_list() {
                return url_list;
            }

            public void setUrl_list(List<?> url_list) {
                this.url_list = url_list;
            }

            @Override
            public void onClick(View v) {
                Intent intent = new Intent(v.getContext(), NewfmActivity.class);
                switch (v.getId()) {
                    case R.id.home_newfm_rl1:
                        intent.putExtra("id",getId());
                        intent.putExtra("title",getTitle());
                        v.getContext().startActivity(intent);
                        break;
                    case R.id.newfm_rl1:
                        //TODO 跳转到播放界面
                         Intent intent1 = new Intent(v.getContext(), PlayerActivity.class);
                        intent1.putExtra("id",getId());
                        v.getContext().startActivity(intent1);
                        break;
                    case R.id.newfm_rl2:
                        Intent intent2 = new Intent(v.getContext(), PlayerActivity.class);
                        intent2.putExtra("id",getId());
                        v.getContext().startActivity(intent2);
                        break;
                    case R.id.newfm_rl3:
                         Intent intent3 = new Intent(v.getContext(), PlayerActivity.class);
                        intent3.putExtra("id",getId());
                         v.getContext().startActivity(intent3);
                        break;
                }

            }

            public static class DiantaiBean {
                private String id;
                private String title;
                private String cover;
                private String fmnum;
                private String user_id;
                private String viewnum;
                private String content;
                private String favnum;

                private UserBean user;

                public String getId() {
                    return id;
                }

                public void setId(String id) {
                    this.id = id;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }

                public String getCover() {
                    return cover;
                }

                public void setCover(String cover) {
                    this.cover = cover;
                }

                public String getFmnum() {
                    return fmnum;
                }

                public void setFmnum(String fmnum) {
                    this.fmnum = fmnum;
                }

                public String getUser_id() {
                    return user_id;
                }

                public void setUser_id(String user_id) {
                    this.user_id = user_id;
                }

                public String getViewnum() {
                    return viewnum;
                }

                public void setViewnum(String viewnum) {
                    this.viewnum = viewnum;
                }

                public String getContent() {
                    return content;
                }

                public void setContent(String content) {
                    this.content = content;
                }

                public String getFavnum() {
                    return favnum;
                }

                public void setFavnum(String favnum) {
                    this.favnum = favnum;
                }

                public UserBean getUser() {
                    return user;
                }

                public void setUser(UserBean user) {
                    this.user = user;
                }

                public static class UserBean {
                    private String id;
                    private String username;
                    private String nickname;
                    private Object phone;
                    private String avatar;

                    public String getId() {
                        return id;
                    }

                    public void setId(String id) {
                        this.id = id;
                    }

                    public String getUsername() {
                        return username;
                    }

                    public void setUsername(String username) {
                        this.username = username;
                    }

                    public String getNickname() {
                        return nickname;
                    }

                    public void setNickname(String nickname) {
                        this.nickname = nickname;
                    }

                    public Object getPhone() {
                        return phone;
                    }

                    public void setPhone(Object phone) {
                        this.phone = phone;
                    }

                    public String getAvatar() {
                        return avatar;
                    }

                    public void setAvatar(String avatar) {
                        this.avatar = avatar;
                    }
                }
            }
        }

        public static class NewlessonBean implements View.OnClickListener {
            private String id;
            private String title;
            private String cover;
            private String url;
            private String speak;
            private String favnum;
            private String viewnum;
            private Object background;
            private boolean is_teacher;
            private String absolute_url;
            private String object_id;
            /**
             * id : 1227
             * title : 朱小杰
             * cover : http://ossimg.xinli001.com/20160909/84cb82d857ee52ba047d5ca6c5f04132.jpg
             * fmnum : 8
             * user_id : 1004388479
             * viewnum : 19666
             * content : 主播比较低调，暂时没有简介
             * favnum : 20
             * user : {"id":"1004388479","username":"xinli001_yida_20160909vpCf","nickname":"朱小杰","phone":null,"avatar":"http://ossimg.xinli001.com/20160909/84cb82d857ee52ba047d5ca6c5f04132.jpg!80"}
             */

            private DiantaiBean diantai;
            private List<?> url_list;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getCover() {
                return cover;
            }

            public void setCover(String cover) {
                this.cover = cover;
            }

            public String getUrl() {
                return url;
            }

            public void setUrl(String url) {
                this.url = url;
            }

            public String getSpeak() {
                return speak;
            }

            public void setSpeak(String speak) {
                this.speak = speak;
            }

            public String getFavnum() {
                return favnum;
            }

            public void setFavnum(String favnum) {
                this.favnum = favnum;
            }

            public String getViewnum() {
                return viewnum;
            }

            public void setViewnum(String viewnum) {
                this.viewnum = viewnum;
            }

            public Object getBackground() {
                return background;
            }

            public void setBackground(Object background) {
                this.background = background;
            }

            public boolean isIs_teacher() {
                return is_teacher;
            }

            public void setIs_teacher(boolean is_teacher) {
                this.is_teacher = is_teacher;
            }

            public String getAbsolute_url() {
                return absolute_url;
            }

            public void setAbsolute_url(String absolute_url) {
                this.absolute_url = absolute_url;
            }

            public String getObject_id() {
                return object_id;
            }

            public void setObject_id(String object_id) {
                this.object_id = object_id;
            }

            public DiantaiBean getDiantai() {
                return diantai;
            }

            public void setDiantai(DiantaiBean diantai) {
                this.diantai = diantai;
            }

            public List<?> getUrl_list() {
                return url_list;
            }

            public void setUrl_list(List<?> url_list) {
                this.url_list = url_list;
            }

            @Override
            public void onClick(View v) {
                //TODO 跳转到播放详情页
                switch (v.getId()) {
                    case R.id.home_newfm_rl1:
                        Intent intent = new Intent(v.getContext(), NewlessonActivity.class);
                        intent.putExtra("id",Integer.parseInt(getId()));
                        intent.putExtra("title",getTitle());
                        v.getContext().startActivity(intent);
                        break;
                    case R.id.newfm_rl1:
                         Intent intent1 = new Intent(v.getContext(), PlayerActivity.class);
                        intent1.putExtra("id",getId());
                        v.getContext().startActivity(intent1);
                        break;
                    case R.id.newfm_rl2:
                        Intent intent2 = new Intent(v.getContext(), PlayerActivity.class);
                        intent2.putExtra("id",getId());
                        v.getContext().startActivity(intent2);
                        break;
                    case R.id.newfm_rl3:
                         Intent intent3 = new Intent(v.getContext(), PlayerActivity.class);
                        intent3.putExtra("id",getId());
                         v.getContext().startActivity(intent3);
                        break;
                }

            }

            public static class DiantaiBean {
                private String id;
                private String title;
                private String cover;
                private String fmnum;
                private String user_id;
                private String viewnum;
                private String content;
                private String favnum;
                /**
                 * id : 1004388479
                 * username : xinli001_yida_20160909vpCf
                 * nickname : 朱小杰
                 * phone : null
                 * avatar : http://ossimg.xinli001.com/20160909/84cb82d857ee52ba047d5ca6c5f04132.jpg!80
                 */

                private UserBean user;

                public String getId() {
                    return id;
                }

                public void setId(String id) {
                    this.id = id;
                }

                public String getTitle() {
                    return title;
                }

                public void setTitle(String title) {
                    this.title = title;
                }

                public String getCover() {
                    return cover;
                }

                public void setCover(String cover) {
                    this.cover = cover;
                }

                public String getFmnum() {
                    return fmnum;
                }

                public void setFmnum(String fmnum) {
                    this.fmnum = fmnum;
                }

                public String getUser_id() {
                    return user_id;
                }

                public void setUser_id(String user_id) {
                    this.user_id = user_id;
                }

                public String getViewnum() {
                    return viewnum;
                }

                public void setViewnum(String viewnum) {
                    this.viewnum = viewnum;
                }

                public String getContent() {
                    return content;
                }

                public void setContent(String content) {
                    this.content = content;
                }

                public String getFavnum() {
                    return favnum;
                }

                public void setFavnum(String favnum) {
                    this.favnum = favnum;
                }

                public UserBean getUser() {
                    return user;
                }

                public void setUser(UserBean user) {
                    this.user = user;
                }

                public static class UserBean {
                    private String id;
                    private String username;
                    private String nickname;
                    private Object phone;
                    private String avatar;

                    public String getId() {
                        return id;
                    }

                    public void setId(String id) {
                        this.id = id;
                    }

                    public String getUsername() {
                        return username;
                    }

                    public void setUsername(String username) {
                        this.username = username;
                    }

                    public String getNickname() {
                        return nickname;
                    }

                    public void setNickname(String nickname) {
                        this.nickname = nickname;
                    }

                    public Object getPhone() {
                        return phone;
                    }

                    public void setPhone(Object phone) {
                        this.phone = phone;
                    }

                    public String getAvatar() {
                        return avatar;
                    }

                    public void setAvatar(String avatar) {
                        this.avatar = avatar;
                    }
                }
            }
        }

        public static class DiantaiBean implements View.OnClickListener {
            private String id;
            private String title;
            private String cover;
            private String fmnum;
            private String user_id;
            private String viewnum;
            private String content;
            private String favnum;
            /**
             * id : 10291411
             * username : 2041911848@qq.com
             * nickname : 壹心理学院
             * phone : 13418114656
             * avatar : http://ossimg.xinli001.com/20151208/c491d6bc71e4469d9e47c48bc5504a6c.jpg!80
             */

            private UserBean user;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getCover() {
                return cover;
            }

            public void setCover(String cover) {
                this.cover = cover;
            }

            public String getFmnum() {
                return fmnum;
            }

            public void setFmnum(String fmnum) {
                this.fmnum = fmnum;
            }

            public String getUser_id() {
                return user_id;
            }

            public void setUser_id(String user_id) {
                this.user_id = user_id;
            }

            public String getViewnum() {
                return viewnum;
            }

            public void setViewnum(String viewnum) {
                this.viewnum = viewnum;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public String getFavnum() {
                return favnum;
            }

            public void setFavnum(String favnum) {
                this.favnum = favnum;
            }

            public UserBean getUser() {
                return user;
            }

            public void setUser(UserBean user) {
                this.user = user;
            }

            @Override
            public void onClick(View v) {
                Intent intent = new Intent(v.getContext(), DianTaiActivity.class);
                v.getContext().startActivity(intent);
            }

            public static class UserBean {
                private String id;
                private String username;
                private String nickname;
                private String phone;
                private String avatar;

                public String getId() {
                    return id;
                }

                public void setId(String id) {
                    this.id = id;
                }

                public String getUsername() {
                    return username;
                }

                public void setUsername(String username) {
                    this.username = username;
                }

                public String getNickname() {
                    return nickname;
                }

                public void setNickname(String nickname) {
                    this.nickname = nickname;
                }

                public String getPhone() {
                    return phone;
                }

                public void setPhone(String phone) {
                    this.phone = phone;
                }

                public String getAvatar() {
                    return avatar;
                }

                public void setAvatar(String avatar) {
                    this.avatar = avatar;
                }
            }
        }
    }
}
